﻿using System;

namespace EOrm
{
    /// <summary>
    /// 连接字符串实例
    /// </summary>
    [Serializable]
    public class ConStr
    {
        /// <summary>
        /// 连接的key，默认为Default
        /// </summary>
        public string ConKey { get; set; } = "default";

        /// <summary>
        /// 数据库主机, Ip地址
        /// </summary>
        public string Host { get; set; } = "";

        /// <summary>
        /// 数据库串口号
        /// </summary>
        public int Port { get; set; } = 0;

        /// <summary>
        /// 数据库名称
        /// </summary>
        public string DbName { get; set; } = "";

        /// <summary>
        /// 数据库用户名
        /// </summary>
        public string User { get; set; } = "";

        /// <summary>
        /// 数据库密码
        /// </summary>
        public string Password { get; set; } = "";

        /// <summary>
        /// 数据库型号
        /// </summary>
        public DbStyle Category { get; set; } = DbStyle.Sqlite;

        /// <summary>
        /// 数据库文件所在位置
        /// </summary>
        public string FilePath { get; set; } = "";

        /// <summary>
        /// 数据库实例
        /// </summary>
        public string Instance { get; set; } = "";

        /// <summary>
        /// 数据库是否直接采用系统认证授权
        /// </summary>
        public bool SysTrusted { get; set; } = false;
        /// <summary>
        /// 数据库版本，一般用于Access
        /// </summary>
        public int Version { get; set; } = 2003;
    }
}
